package com.bluefeather.songlyric;

import android.app.Dialog;
import android.widget.Button;
import android.widget.ImageButton;
import android.view.View;

public class BookmarkDialog extends Dialog implements View.OnClickListener {
	
	private MusicActivity		_activity;

	public BookmarkDialog(MusicActivity activity) {
		super(activity);
		_activity = activity;
		setContentView(R.layout.dlg_bookmark);
		ImageButton ib = (ImageButton)findViewById(R.id.ib_bookmark_music);
		ib.setOnClickListener(this);
		ib = (ImageButton)findViewById(R.id.ib_delete_lyric);
		ib.setOnClickListener(this);
		ib = (ImageButton)findViewById(R.id.ib_switch_lyric);
		ib.setOnClickListener(this);
		ib = (ImageButton)findViewById(R.id.ib_switch_bg);
		ib.setOnClickListener(this);
		Button b = (Button)findViewById(R.id.b_bookmark_music);
		b.setOnClickListener(this);
		b = (Button)findViewById(R.id.b_delete_lyric);
		b.setOnClickListener(this);
		b = (Button)findViewById(R.id.b_switch_lyric);
		b.setOnClickListener(this);
		b = (Button)findViewById(R.id.b_switch_bg);
		b.setOnClickListener(this);
		setTitle(R.string.app_name);
	}

	@Override
	public void onClick(View v) {
		switch(v.getId()) {
		case R.id.ib_bookmark_music :
		case R.id.b_bookmark_music :
			_activity.bookmarkMusic();
			break;
		case R.id.ib_delete_lyric :
		case R.id.b_delete_lyric :
			_activity.deleteLyric();
			break;
		case R.id.ib_switch_lyric :
		case R.id.b_switch_lyric :
			_activity.populateNextLyric();
			break;
		case R.id.ib_switch_bg :
		case R.id.b_switch_bg :
			_activity.switchBackground();
			break;
		}
		dismiss();
	}

}
